﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.IO.Ports;
using SMS.Core.DataEntity;
using SMS.Common.Search;

namespace SMS.Contract
{
    public class SMSClient : ClientBase<ISMSService>, ISMSService, IDisposable
    {
        #region ISMSService 成员

        #region SMSHandler

        public bool Start(out string message)
        {
            return base.Channel.Start(out message);
        }

        public bool Stop(out string message)
        {
            return base.Channel.Stop(out message);
        }

        public bool SendCommand(string command, out string message)
        {
            return base.Channel.SendCommand(command, out message);
        }

        public bool SendMessageImmediately(string number, string content, out string message)
        {
            return base.Channel.SendMessageImmediately(number, content, out message);
        }

        public bool SendMessage(string number, string content)
        {
            return base.Channel.SendMessage(number, content);
        }

        public bool SendMessageWithTag(string tag, string number, string content)
        {
            return base.Channel.SendMessageWithTag(tag, number, content);
        }

        public string GetCurrentNumber()
        {
            return base.Channel.GetCurrentNumber();
        }

        public void SetCurrentNumber(string number)
        {
            base.Channel.SetCurrentNumber(number);
        }

        public bool GetConnectionState()
        {
            return base.Channel.GetConnectionState();
        }

        public bool GetAutoSendState()
        {
            return base.Channel.GetAutoSendState();
        }

        public void SetAutoSendState(bool autoSendState)
        {
            base.Channel.SetAutoSendState(autoSendState);
        }

        public bool GetAutoReceiveState()
        {
            return base.Channel.GetAutoReceiveState();
        }

        public void SetAutoReceiveState(bool autoReceiveState)
        {
            base.Channel.SetAutoReceiveState(autoReceiveState);
        }

        #endregion

        #region SendMessage

        public SendMessage GetSendMessage(string sendKeyid)
        {
            return base.Channel.GetSendMessage(sendKeyid);
        }

        public int GetStatusWithTag(string tag)
        {
            return base.Channel.GetStatusWithTag(tag);
        }

        public SendMessage[] GetSendMessageWithTag(string tag)
        {
            return base.Channel.GetSendMessageWithTag(tag);
        }

        public int GetStatusWithEventTag(string eventTag)
        {
            return base.Channel.GetStatusWithEventTag(eventTag);
        }

        public SendMessage[] GetSendMessageWithEventTag(string eventTag)
        {
            return base.Channel.GetSendMessageWithEventTag(eventTag);
        }

        public SearchResult<SendMessage> SearchSendMessage(SearchCondition condition)
        {
            return base.Channel.SearchSendMessage(condition);
        }

        public int AddSendMessage(SendMessage sendMessage)
        {
            return base.Channel.AddSendMessage(sendMessage);
        }

        public int AddSendMessages(SendMessage[] sendMessages)
        {
            return base.Channel.AddSendMessages(sendMessages);
        }

        public int UpdateSendMessage(SendMessage sendMessage)
        {
            return base.Channel.UpdateSendMessage(sendMessage);
        }

        public int UpdateSendMessages(SendMessage[] sendMessages)
        {
            return base.Channel.UpdateSendMessages(sendMessages);
        }

        public int DeleteSendMessage(string sendKeyid)
        {
            return base.Channel.DeleteSendMessage(sendKeyid);
        }

        public int DeleteSendMessages(string[] sendKeyids)
        {
            return base.Channel.DeleteSendMessages(sendKeyids);
        }

        #endregion

        #region ReceiveMessage

        public ReceiveMessage GetReceiveMessage(string receiveKeyid)
        {
            return base.Channel.GetReceiveMessage(receiveKeyid);
        }

        public ReceiveMessage[] GetReplyMessage(string sendKeyid)
        {
            return base.Channel.GetReplyMessage(sendKeyid);
        }

        public ReceiveMessage[] GetReplyReceiveMessage(string receiveNumber, string replyCode)
        {
            return base.Channel.GetReplyReceiveMessage(receiveNumber, replyCode);
        }

        public SearchResult<ReceiveMessage> SearchReceiveMessage(SearchCondition condition)
        {
            return base.Channel.SearchReceiveMessage(condition);
        }

        public int AddReceiveMessage(ReceiveMessage receiveMessage)
        {
            return base.Channel.AddReceiveMessage(receiveMessage);
        }

        public int AddReceiveMessages(ReceiveMessage[] receiveMessages)
        {
            return base.Channel.AddReceiveMessages(receiveMessages);
        }

        public int UpdateReceiveMessage(ReceiveMessage receiveMessage)
        {
            return base.Channel.UpdateReceiveMessage(receiveMessage);
        }

        public int UpdateReceiveMessages(ReceiveMessage[] receiveMessages)
        {
            return base.Channel.UpdateReceiveMessages(receiveMessages);
        }

        public int DeleteReceiveMessage(string receiveKeyid)
        {
            return base.Channel.DeleteReceiveMessage(receiveKeyid);
        }

        public int DeleteReceiveMessages(string[] receiveKeyids)
        {
            return base.Channel.DeleteReceiveMessages(receiveKeyids);
        }

        #endregion

        #region SMSMessage

        public SMSMessage[] GetSendSMSMessage(string sendKeyid)
        {
            return base.Channel.GetSendSMSMessage(sendKeyid);
        }

        public SMSMessage GetReceiveSMSMessage(string receiveKeyid)
        {
            return base.Channel.GetReceiveSMSMessage(receiveKeyid);
        }

        public SMSMessage[] GetEventTagSMSMessage(string eventTag)
        {
            return base.Channel.GetEventTagSMSMessage(eventTag);
        }

        public SearchResult<SMSMessage> SearchSMSMessage(SearchCondition condition)
        {
            return base.Channel.SearchSMSMessage(condition);
        }

        #endregion

        #endregion
    }
}
